package cn.com.xuhx;

import cn.hutool.http.webservice.SoapClient;

public class App {

    //使用hutel工具需要借助SoapUI工具将wsdl解析成soap内容

    /**
     *

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xuhx="http://xuhx.com.cn/">
        <soapenv:Header/>
        <soapenv:Body>
        <xuhx:sayHello>
        <!--Optional:-->
        <content>张三</content></xuhx:sayHello>
        </soapenv:Body>
     </soapenv:Envelope>
     * @param args
     */
    public static void main(String[] args) {
        SoapClient soapClient = SoapClient.create("http://localhost:8899/hello_server?wsdl=HelloService.wsdl")
                .setMethod("xuhx:sayHello","http://xuhx.com.cn/")
                .setParam("content", "张三",false);//方法是否要加前缀看上面的xml
        String send = soapClient.send(true);
        System.out.println(send);   //最后返回的结果是xml
    }
}
